package com.naizhuai.util;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.naizhuai.R;

import java.io.File;

/**
 * Created by code_han on 2018/5/24.
 */

public class ImageUtils {

    public static void glideImageViewByUrl(Context context,ImageView image, String url){
        Glide.with(context).load(url)
                .placeholder(R.mipmap.wrong_image_icon).crossFade().error(R.mipmap.wrong_image_icon)
                .into(image);
    }

    public static void glideThumbViewByUrl(Context context,ImageView image, String url){
        Glide.with(context).load(url)
                .placeholder(R.mipmap.virtual_user_image_thumb).dontAnimate().error(R.mipmap.virtual_user_image_thumb)
                .into(image);
    }

    public static void glideImageViewByFile(Context context,ImageView image, File file){
        Glide.with(context).load(file)
                .placeholder(R.mipmap.wrong_image_icon).dontAnimate().error(R.mipmap.wrong_image_icon)
                .into(image);
    }


}
